#ifndef _FUNS_H_
#define _FUNS_H_
#include <string>
#include "group.hpp"
#include "user.hpp"
#include <functional>
#include <unordered_map>

using CommandsHanlder = std::function<void(int, std::string)>;
extern std::unordered_map<std::string, std::string> commandsMap;
extern std::unordered_map<std::string, CommandsHanlder> commandsHanlders;
extern User g_curUser;
extern std::vector<Group> g_groups;
void printCurDateTime();
int sendMsg(int cfd, const char* msg, int len);
void showMainMenu(int fd);
void help(int, std::string s = "");
void chat(int, std::string);
void logout(int, std::string);
void addFriend(int ,std::string);
void addGroup(int, std::string);
void createGroup(int, std::string);
void groupChat(int, std::string);
void showGroupsInfo();
#endif // _FUNS_H